import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: () =>
      import(/* webpackChunkName: "userinfo" */ "../views/Home.vue"),
    meta: {
      title: "主页",
    },
  },
  {
    path: "/self/info",
    name: "SelfInfo",
    component: () =>
      import(/* webpackChunkName: "SelfInfo" */ "../views/self/Info.vue"),
    meta: {
      title: "个人信息",
    },
  },
  {
    path: "/self/modify",
    name: "SelfModify",
    component: () =>
      import(/* webpackChunkName: "SelfModify" */ "../views/self/Modify.vue"),
    meta: {
      title: "修改密码",
    },
  },
  {
    path: "/document/module",
    name: "DocumentModule",
    component: () =>
      import(
        /* webpackChunkName: "DocumentModule" */ "../views/document/Module.vue"
      ),
    meta: {
      title: "列表筛选",
    },
  },
  {
    path: "/document/create",
    name: "DocumentCreate",
    component: () =>
      import(
        /* webpackChunkName: "DocumentCreate" */ "../views/document/Create.vue"
      ),
    meta: {
      title: "文档创建",
    },
  },
  {
    path: "/document/tools",
    name: "DocumentTools",
    component: () =>
      import(
        /* webpackChunkName: "DocumentTools" */ "../views/document/Tools.vue"
      ),
    meta: {
      title: "网站工具",
    },
  },
  {
    path: "/document/view",
    name: "DocumentView",
    component: () =>
      import(
        /* webpackChunkName: "DocumentTools" */ "../views/document/View.vue"
      ),
    meta: {
      title: "PDF预览",
    },
  },
  {
    path: "/tool/pull",
    name: "ToolPull",
    component: () =>
      import(/* webpackChunkName: "ToolPull" */ "../views/tool/Pull.vue"),
    meta: {
      title: "git更新",
    },
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});
export default router;
